import { request } from '@/utils/request.js'

export default {

//装车
entrucking(data = {},id){
    return request({
      url: 'warehouse/car/entrucking',
      method: 'post',
      data
    })
  },
  
  /**
   * 获取发车分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'warehouse/car/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加发车
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'warehouse/car/save',
      method: 'post',
      data
    })
  },

  /**
   * 更新发车数据
   * @returns
   */
  update (id, data = {}) {
    return request({
      url: 'warehouse/car/update/' + id,
      method: 'put',
      data
    })
  },
  /**
   * 更新发车数据
   * @returns
   */
  updated (data = {}) {
    return request({
      url: 'warehouse/car/update',
      method: 'post',
      data
    })
  },

  /**
   * 读取发车
   * @returns
   */
  read (id,data={}) {
    return request({
      url: 'warehouse/car/read/' + id,
      method: 'get',
      data
    })
  },

  /**
   * 将发车删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'warehouse/car/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 从回收站获取发车数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'warehouse/car/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复发车数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'warehouse/car/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除发车
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'warehouse/car/realDelete',
      method: 'delete',
      data
    })
  },

  /**
   * 更改发车数据
   * @returns
   */
  changeStatus (data = {}) {
    return request({
      url: 'warehouse/car/changeStatus',
      method: 'put',
      data
    })
  },
  /**
   * 更改发车数据
   * @returns
   */
  execl (id) {
    return request({
      url: 'warehouse/car/execl/'+id,
      method: 'post',
      responseType: 'blob'
    })
  },

}

